using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class JobSeekers_search : System.Web.UI.Page
{
    string connectionString = "";
    protected void Page_Load(object sender, EventArgs e)
    {    
        try
        {
        connectionString =
        WebConfigurationManager.ConnectionStrings[
        "RecruitVietnam"].ConnectionString;
        RegisterJavaScript();
        if(!IsPostBack)
           {
            LoadDataForDropDownList();
           }
        }
        catch(Exception ex)
        {
            Literal1.Text = ex.Message;
        }
    }
    void LoadDataForDropDownList()
    {
        Common cls = new Common(connectionString);
        DataSet dataSet = cls.GetDataSet(
        "select * from tblJobCategories; " +
        "Select * from tblJobIndustries;" +
          "select * from tblProvinces");
        DropDownListHelper helper =
        new DropDownListHelper();
        helper.FillDataTableToDropDownList(
        dataSet, new DropDownList[3] { 
        jobCategory, jobIndustry, province },
        new string[3]{"JobCategoryName", 
            "JobIndustryName","ProvinceName"},
        new string[3]{"JobCategoryID", 
            "JobIndustryID","ProvinceID"},
        new string[3] { "", "", "" });
    }
    void RegisterJavaScript()
    {
        string javaScript =
        "function ShowAdvanced(obj){" +
        "var type='block';" +
        " if(obj.value=='[Basic]')" +
        "{type='none';obj.value='[More options]';}" +
        " else {type='block';obj.value='[Basic]';}";
        javaScript += "document.getElementById(\"" +
        "trCategory\").style.display=type;";
        javaScript += "document.getElementById(\"" +
        "trProvince\").style.display=type;";
        javaScript += "document.getElementById(\"" +
        "trIndustry\").style.display=type;" +
        "return false;}";
        ClientScript.RegisterClientScriptBlock(
        this.GetType(), "AdvancedSearch",
        javaScript, true);
    }
 
   
}
